import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class StatusBar {
  /// 根据主题动态设置状态栏样式
  static void updateStatusBar(ThemeMode themeMode, ThemeData theme) {
    final Brightness statusBarIconBrightness = 
        themeMode == ThemeMode.dark || theme.brightness == Brightness.dark
        ? Brightness.light
        : Brightness.dark;

    SystemChrome.setSystemUIOverlayStyle(
      SystemUiOverlayStyle(
        // theme.scaffoldBackgroundColor
        statusBarColor: Colors.transparent,
        statusBarIconBrightness: statusBarIconBrightness,
      ),
    );
  }
}
